package com.dreamsail.core.model.system;

import com.dreamsail.core.constant.ErrorMessage;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 全局返回结果
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result <T>{
    // 返回码 默认成功
    private int code = ErrorMessage.SYS_SUCCESS.getCode();

    // 返回的错误消息
    private String msg;

    // 返回内容
    private T data;

    public Result(T data) {
        this.code = ErrorMessage.SYS_SUCCESS.getCode();
        this.data = data;
    }
}
